/*
 * @Author: malei
 * @Date: 2021-06-16 16:54:44
 * @LastEditors: malei
 * @LastEditTime: 2021-06-16 16:56:35
 */
#pragma once

#include "api/scoped_refptr.h"
#include "modules/video_capture/video_capture_impl.h"

using namespace webrtc;

class ExternalVideoCapturerModule : public webrtc::videocapturemodule::VideoCaptureImpl
{
public:
  ExternalVideoCapturerModule();

  void OnExternalVideoCaptured(const uint8_t *data, unsigned int len, const VideoCaptureCapability &cb, int64_t ntpTimestamp);

  int32_t StartCapture(const VideoCaptureCapability &capability) override;
  int32_t StopCapture() override;

  bool CaptureStarted() override;
  int32_t CaptureSettings(VideoCaptureCapability &settings) override;

protected:
  ~ExternalVideoCapturerModule() override;
};
